package CS647ConcreteTestCase;

import A3GCConcreteTestCase.ConcreteNode;
import A3GCConcreteTestCase.LocationSupervisorRole;

public class Launcher 
{
	private static final String LONDON = "London";
	private static final String MANCHESTER = "Manchester";
	private static final String LIVERPOOL = "Liverpool";
	private static final String RED = "Red";
	private static final String BLUE = "Blue";
	private static final String GREEN = "Green";
	
	public static void main( String[] args )
	{
		try
		{	
			ConcreteNode londonNode1 = new ConcreteNode("The London Node 1");
			londonNode1.addSupervisorRole(LONDON, new LocationSupervisorRole( 1, LONDON ));
			londonNode1.addFollowerRole(RED, new RedFollower( 1, RED ) );
			londonNode1.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			londonNode1.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			londonNode1.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			londonNode1.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			londonNode1.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			londonNode1.joinGroup(LONDON);
			
			Thread.sleep(1000);

			ConcreteNode londonNode2 = new ConcreteNode("The London Node 2");
			londonNode2.addSupervisorRole(LONDON, new LocationSupervisorRole( 1, LONDON ));
			londonNode2.addFollowerRole(RED, new RedFollower( 1, RED ) );
			londonNode2.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			londonNode2.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			londonNode2.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			londonNode2.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			londonNode2.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			londonNode2.joinGroup(LONDON);
			
			Thread.sleep(1000);

			ConcreteNode londonNode3 = new ConcreteNode("The London Node 3");
			londonNode3.addSupervisorRole(LONDON, new LocationSupervisorRole( 1, LONDON ));
			londonNode3.addFollowerRole(RED, new RedFollower( 1, RED ) );
			londonNode3.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			londonNode3.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			londonNode3.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			londonNode3.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			londonNode3.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			londonNode3.joinGroup(LONDON);
			
			Thread.sleep(1000);

			ConcreteNode londonNode4 = new ConcreteNode("The London Node 4");
			londonNode4.addSupervisorRole(LONDON, new LocationSupervisorRole( 1, LONDON ));
			londonNode4.addFollowerRole(RED, new RedFollower( 1, RED ) );
			londonNode4.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			londonNode4.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			londonNode4.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			londonNode4.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			londonNode4.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			londonNode4.joinGroup(LONDON);
			
			Thread.sleep(1000);

			ConcreteNode londonNode5 = new ConcreteNode("The London Node 5");
			londonNode5.addSupervisorRole(LONDON, new LocationSupervisorRole( 1, LONDON ));
			londonNode5.addFollowerRole(RED, new RedFollower( 1, RED ) );
			londonNode5.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			londonNode5.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			londonNode5.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			londonNode5.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			londonNode5.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			londonNode5.joinGroup(LONDON);
			
			Thread.sleep(1000);
			
			ConcreteNode manchesterNode1 = new ConcreteNode("The Manchester Node 1");
			manchesterNode1.addSupervisorRole(MANCHESTER, new LocationSupervisorRole( 1, MANCHESTER ));
			manchesterNode1.addFollowerRole(RED, new RedFollower( 1, RED ) );
			manchesterNode1.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			manchesterNode1.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			manchesterNode1.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			manchesterNode1.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			manchesterNode1.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );

			manchesterNode1.joinGroup(MANCHESTER);
			
			Thread.sleep(1000);

			ConcreteNode manchesterNode2 = new ConcreteNode("The Manchester Node 2");
			manchesterNode2.addSupervisorRole(MANCHESTER, new LocationSupervisorRole( 1, MANCHESTER ));
			manchesterNode2.addFollowerRole(RED, new RedFollower( 1, RED ) );
			manchesterNode2.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			manchesterNode2.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			manchesterNode2.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			manchesterNode2.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			manchesterNode2.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );			
			
			manchesterNode2.joinGroup(MANCHESTER);
			
			Thread.sleep(1000);

			ConcreteNode manchesterNode3 = new ConcreteNode("The Manchester Node 3");
			manchesterNode3.addSupervisorRole(MANCHESTER, new LocationSupervisorRole( 1, MANCHESTER ));
			manchesterNode3.addFollowerRole(RED, new RedFollower( 1, RED ) );
			manchesterNode3.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			manchesterNode3.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			manchesterNode3.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			manchesterNode3.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			manchesterNode3.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			manchesterNode3.joinGroup(MANCHESTER);
			
			Thread.sleep(1000);

			ConcreteNode manchesterNode4 = new ConcreteNode("The Manchester Node 4");
			manchesterNode4.addSupervisorRole(MANCHESTER, new LocationSupervisorRole( 1, MANCHESTER ));
			manchesterNode4.addFollowerRole(RED, new RedFollower( 1, RED ) );
			manchesterNode4.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			manchesterNode4.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			manchesterNode4.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			manchesterNode4.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			manchesterNode4.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			manchesterNode4.joinGroup(MANCHESTER);
			
			Thread.sleep(1000);

			ConcreteNode manchesterNode5 = new ConcreteNode("The Manchester Node 5");
			manchesterNode5.addSupervisorRole(MANCHESTER, new LocationSupervisorRole( 1, MANCHESTER ));
			manchesterNode5.addFollowerRole(RED, new RedFollower( 1, RED ) );
			manchesterNode5.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			manchesterNode5.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			manchesterNode5.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			manchesterNode5.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			manchesterNode5.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			manchesterNode5.joinGroup(MANCHESTER);
			
			Thread.sleep(1000);
			
			ConcreteNode liverpoolNode1 = new ConcreteNode("The Liverpool Node 1");
			liverpoolNode1.addSupervisorRole(LIVERPOOL, new LocationSupervisorRole( 1, LIVERPOOL ));
			liverpoolNode1.addFollowerRole(RED, new RedFollower( 1, RED ) );
			liverpoolNode1.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			liverpoolNode1.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			liverpoolNode1.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			liverpoolNode1.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			liverpoolNode1.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			liverpoolNode1.joinGroup(LIVERPOOL);
			
			Thread.sleep(1000);

			ConcreteNode liverpoolNode2 = new ConcreteNode("The Liverpool Node 2");
			liverpoolNode2.addSupervisorRole(LIVERPOOL, new LocationSupervisorRole( 1, LIVERPOOL ));
			liverpoolNode2.addFollowerRole(RED, new RedFollower( 1, RED ) );
			liverpoolNode2.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			liverpoolNode2.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			liverpoolNode2.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			liverpoolNode2.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			liverpoolNode2.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			liverpoolNode2.joinGroup(LIVERPOOL);
			
			Thread.sleep(1000);

			ConcreteNode liverpoolNode3 = new ConcreteNode("The Liverpool Node 3");
			liverpoolNode3.addSupervisorRole(LIVERPOOL, new LocationSupervisorRole( 1, LIVERPOOL ));
			liverpoolNode3.addFollowerRole(RED, new RedFollower( 1, RED ) );
			liverpoolNode3.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			liverpoolNode3.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			liverpoolNode3.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			liverpoolNode3.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			liverpoolNode3.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			liverpoolNode3.joinGroup(LIVERPOOL);
			
			Thread.sleep(1000);

			ConcreteNode liverpoolNode4 = new ConcreteNode("The Liverpool Node 4");
			liverpoolNode4.addSupervisorRole(LIVERPOOL, new LocationSupervisorRole( 1, LIVERPOOL ));
			liverpoolNode4.addFollowerRole(RED, new RedFollower( 1, RED ) );
			liverpoolNode4.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			liverpoolNode4.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			liverpoolNode4.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			liverpoolNode4.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			liverpoolNode4.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			liverpoolNode4.joinGroup(LIVERPOOL);
			
			Thread.sleep(1000);

			ConcreteNode liverpoolNode5 = new ConcreteNode("The Liverpool Node 5");
			liverpoolNode5.addSupervisorRole(LIVERPOOL, new LocationSupervisorRole( 1, LIVERPOOL ));
			liverpoolNode5.addFollowerRole(RED, new RedFollower( 1, RED ) );
			liverpoolNode5.addFollowerRole(GREEN, new GreenFollower( 1, GREEN ) );
			liverpoolNode5.addFollowerRole(BLUE, new BlueFollower( 1, BLUE ) );
			liverpoolNode5.addSupervisorRole(RED, new RedSupervisor(1, RED) );
			liverpoolNode5.addSupervisorRole(GREEN, new GreenSupervisor(1, GREEN) );
			liverpoolNode5.addSupervisorRole(BLUE, new BlueSupervisor(1, BLUE) );
			
			liverpoolNode5.joinGroup(LIVERPOOL);
			
			Thread.sleep(120000);
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
		
		System.exit(0);
	}
}
